import Vue from 'vue'
import Router from 'vue-router'
import header from '../components/header'
import category from '../components/category/category'
import male from '../components/category/male/male'
import female from '../components/category/female/female'
import press from '../components/category/press/press'
import picture from '../components/category/picture/picture'
import bookinfo from '../components/bookinfo/bookinfo'
import ranking from '../components/ranking/ranking'
import RankingMale from '../components/ranking/male/RankingMale'
import RankingFemale from '../components/ranking/female/RankingFemale'
import rankingPicture from '../components/ranking/picture/rankingPicture'
import RankingPress from '../components/ranking/press/RankingPress'
import bookshelf from '../components/bookshelf/bookshelf'
import BookChapter from '../components/bookchapter/BookChapter'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '',
      redirect: '/category/male'
    },
    {
      path: '*',
      redirect: '/category/male'
    },
    {
      path: '/',
      component: header,
      children: [
        {
          path: '/bookchapter/:bookId',
          component: BookChapter
        },
        {
          path: '/bookinfo/:bookId',
          component: bookinfo
        },
        {
          path: '/bookshelf',
          component: bookshelf
        },
        {
          path: '/ranking',
          component: ranking,
          children: [
            {
              path: 'rmale',
              component: RankingMale
            },
            {
              path: 'rfemale',
              component: RankingFemale
            },
            {
              path: 'rpicture',
              component: rankingPicture
            },
            {
              path: 'rpress',
              component: RankingPress
            }
          ]
        },
        {
          path: 'category',
          component: category,
          children: [
            {
              path: 'male',
              component: male
            },
            {
              path: 'female',
              component: female
            },
            {
              path: 'press',
              component: press
            },
            {
              path: 'picture',
              component: picture
            }
          ]
        }
      ]
    }
  ],
  mode: 'history'
})
